<div class="container_12 content-wrapper">
	
    <div class="grid_12">
		<h2>Products</h2>
		<?php flash(); ?>
		<?php if(!empty($products)):?>
		<ul class="product">
			<?php 
			$ctr = 0;
			foreach($products as $p):
				if($ctr >=2) $ctr = 0;		
			?>
			<li <?php echo $ctr%2 != 0 ? 'class="center"':'';?>>
			<div class="ptitle"><a href="<?php echo site_url('home/view_product/'.$p->id); ?>" class="plink"><?php echo $p->name; ?></a></div>
			<div class="pprice">PHP <?php echo number_format($p->price, 2); ?></div>
			<div class="pimage"><img src="<?php echo site_url().'/'.$p->image;?>" width="150px" height="150px"/></div>
			<p class="pdesc"><?php echo character_limiter($p->description, 10); ?> </p>
			<a href="<?php echo site_url('home/add_to_cart/'.$p->id);?>" class="add_to_cart dbtn">Add to cart</a>
			</li>
			
			<?php 
				$ctr++;
				endforeach;
			?>
		</ul>
		<?php endif;?>

    
 	
	</div>

   
</div>